import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/update',
    method: 'post',
    data: row
  })
}
/*设备下拉框*/
export const getDeviceList = (deviceType) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/deviceList',
    method: 'get',
    params: {
      deviceType
    }
  })
}
/*属性下拉框*/
export const getAttrList = (id) => {
  return request({
    url: '/api/blade-platform/productattributemode/getSubset',
    method: 'get',
    params: {
      id
    }
  })
}
/*条件下拉框*/
export const getConditionList = (id) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/condition',
    method: 'get',
    params: {
      id
    }
  })
}
/*修改状态*/
export const updateStatus = (row) => {
  return request({
    url: '/api/blade-platform/productdevicealarm/updateStatus',
    method: 'post',
    data: row
  })
}

